//头文件
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <chrono>
#include <ctime>

using namespace std;

std::string millisecond_to_str()
{
    auto milliseconds = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count();

    std::chrono::milliseconds ms(milliseconds);

    std::chrono::time_point<std::chrono::high_resolution_clock, std::chrono::milliseconds> t1(ms);

    std::time_t t = std::chrono::system_clock::to_time_t(t1);

    std::stringstream ss;

    auto const msecs = ms.count() % 1000;

    ss << "[" << std::put_time(std::localtime(&t), "%Y-%m-%d %H:%M:%S") << ":" << msecs << "] : ";
    return ss.str();
}

int main()
{
    std::ofstream log_("pose_log.txt", std::ios_base::app);
    std::cout << "deebot start : " << millisecond_to_str() << "\n";
    log_ << "deebot start : " << millisecond_to_str() << "\n";
    log_.close();
    return 0;
}